package tech.aistar.day06;

import java.util.Arrays;

/**
 * 本类用来演示: 实体类 - 注重数据的存储
 *
 * @author: success
 * @date: 2021/3/12 4:42 下午
 */
public class Emp {
    private int id;//编号

    private String name;//姓名

    private double salary;//工资

    private Emp[] emps;//一个上司拥有多个下属

    public Emp() {
    }

    public Emp(int id, String name, double salary, Emp[] emps) {
        this.id = id;
        this.name = name;
        this.salary = salary;
        this.emps = emps;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public Emp[] getEmps() {
        return emps;
    }

    public void setEmps(Emp[] emps) {
        this.emps = emps;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Emp{");
        sb.append("id=").append(id);
        sb.append(", name='").append(name).append('\'');
        sb.append(", salary=").append(salary);
        sb.append(", emps=").append(Arrays.toString(emps));
        sb.append('}');
        return sb.toString();
    }
}
